import sys

line = sys.stdin.readline()
lst = line.split()
print(len(lst[-1]))

line = input()
lst = line.split()
print(len(lst[-1]))

# 精简版本
print(len(sys.stdin.readline().split()[-1]))
print(len(input().split()[-1]))
